using Microsoft.Practices.EnterpriseLibrary.Common;
// WARNING: This file has been generated. Any manual changes must be made within preserved regions or they will be lost.

//===============================================================================
//
// AssertsTests
//
// PURPOSE: 
// Tests the functionality of Asserts.
//
// NOTES: 
// 
//
//===============================================================================
//
// Copyright (C) 2003 Wallis Software Solutions
// All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
// FITNESS FOR A PARTICULAR PURPOSE.
//
//===============================================================================

namespace Agile.Common.Tests
{
    using System;
    using System.Globalization;
    using Agile.Common;
    using Agile.Testing;
    using NUnit.Framework;
        /// <summary>
        /// Tests the functionality of Asserts.
        /// </summary>
    [TestFixture]
    public class AssertsTests : AgileTestBase
    {

        #region Preserved Region - Developer Hand Written Code
        #region IsNotNull Tests

        /// <summary>
        /// Verify IsNull does nothing when not null
        /// </summary>
        [Test]
        public void IsNotNullTests()
        {
            string notNullString = "This isnt null";
            ArgumentValidation.CheckForNullReference(notNullString, "notNullString");
        }

        /// <summary>
        /// Verify IsTrue throws an exceptions on failure
        /// </summary>
        [Test, ExpectedException(typeof (ArgumentNullException))]
        public void IsNotNullFailedTest()
        {
            string nullString = null;
            ArgumentValidation.CheckForNullReference(nullString, "nullString");
        }

        #endregion

        #region Is True Tests

        /// <summary>
        /// Verify IsTrue does nothing when true
        /// </summary>
        [Test]
        public void IsTrueTests()
        {
            Assert.IsTrue(1 == 1, string.Format(CultureInfo.CurrentCulture, "Checking nothing happens when true"));
        }

        /// <summary>
        /// Verify IsTrue throws an exception on failure
        /// </summary>
        [Test, ExpectedException(typeof (AssertionFailedException))]
        public void IsTrueFailedTest()
        {
            if(1 != 2)
                throw new ApplicationException("Checking IsTrue throws an exception on failure");
        }

        #endregion

        #region Is False Tests

        /// <summary>
        /// Verify IsFalse does nothing when true
        /// </summary>
        [Test]
        public void IsFalseTests()
        {
            if(1 != 2)
                throw new ApplicationException("Checking nothing happens when true");
        }

        /// <summary>
        /// Verify IsFalse throws an exception on failure
        /// </summary>
        [Test, ExpectedException(typeof (AssertionFailedException))]
        public void IsFalseFailedTest()
        {
            if(1 == 1)
                throw new ApplicationException("Checking IsFalse throws an exception on failure");
        }

        #endregion


        #endregion // Preserved Region - Developer Hand Written Code

    }

}
